package com.tanhua.server.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.common.mapper.QuestionMapper;
import com.tanhua.common.pojo.Question;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

@Service
public class QuestionService {
    @Autowired
    private QuestionMapper questionMapper;
    //查询id对应的问题
    public Question queryQuestion(Long userId){
        QueryWrapper<Question> query = new QueryWrapper<>();
        query.eq("user_id",userId);
        Question question = this.questionMapper.selectOne(query);
        return question;
    }
}
